{extend name="admin@index_layout"/}
{block name="main"}
<style type="text/css">
.childrenBody {
    background: #fff;
}
</style>
<div class="layui-form">
    <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
</div>
<script type="text/html" id="barTool">
    <a href='{:url("admin/formguide.info/index")}?formid={{ d.id }}' class="layui-btn layui-btn-xs layui-btn-primary">信息列表</a>
    <a href='{:url("index/formguide/index")}?id={{ d.id }}' target="_blank" class="layui-btn layui-btn-xs">前台浏览</a>
    <a href='{:url("admin/formguide.field/index")}?id={{ d.id }}' class="layui-btn layui-btn-xs layui-btn-normal">字段管理</a>
    <a data-open='{:url("edit")}?id={{ d.id }}' class="layui-btn layui-btn-xs" title="编辑"><i class='iconfont icon-brush_fill'></i></a>
    <a href='{:url("del")}?id={{ d.id }}' class="layui-btn layui-btn-danger layui-btn-xs layui-tr-del"><i class='iconfont icon-trash_fill'></i></a>
</script>
{/block}
{block name="script"}
<script>
layui.use('yznTable', function() {
    var table = layui.yznTable;

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTable',
        add_url: "{:url('add')}",
    };

    table.render({
        init: init,
        toolbar: ['refresh', 'add'],
        url: '{:url("index")}',
        search:false,
        cols: [
            [
                { field: 'id', width: 60, title: 'ID' },
                { field: 'name',  align: "left",title: '表单名称(信息数)'},
                { field: 'tablename', align: "left", width: 200, title: '表名' },
                { field: 'description', width: 200, title: '简介' },
                { field: 'create_time', width: 180, title: '创建时间' },
                { field: 'status', width: 80,title: '状态',templet: yznTable.formatter.status,selectList:{0:'禁用',1:'正常'},search:false},
                { fixed: 'right', width: 300, title: '操作', toolbar: '#barTool' }
            ]
        ],
    });
});
</script>
{/block}